package net.bwie.realtime.jtp.Rpfunction;


import org.apache.flink.api.java.tuple.Tuple4;
import org.apache.flink.streaming.api.functions.windowing.WindowFunction;
import org.apache.flink.streaming.api.windowing.windows.TimeWindow;
import org.apache.flink.util.Collector;

/**
 * 简介说明:
 *
 * @author: LiLi
 * @date: 2025/05/28 10:35:37
 * @version: 1.0
 */
public class TopNHotWindowFunction implements WindowFunction<Long, Tuple4<Long, Long,Integer, Long>, Integer, TimeWindow> {
    @Override
    public void apply(Integer integer, TimeWindow window, Iterable<Long> input, Collector<Tuple4<Long, Long, Integer, Long>> out) throws Exception {

        Long count = input.iterator().next();
        out.collect(Tuple4.of(window.getStart() ,window.getEnd(),integer,count));

    }
}
